$(function() {
    
            var $fullText = $('.admin-fullText');
            $('#admin-fullscreen').on('click', function() {
                $.AMUI.fullscreen.toggle();
            });
    
            $(document).on($.AMUI.fullscreen.raw.fullscreenchange, function() {
                $fullText.text($.AMUI.fullscreen.isFullscreen ? '退出全屏' : '开启全屏');
            });
    
    
          /*  var dataType = $('body').attr('data-type');
            for (key in pageData) {
                if (key == dataType) {
                    pageData[key]();
                }
            }*/
    
            $('.tpl-switch').find('.tpl-switch-btn-view').on('click', function() {
                $(this).prev('.tpl-switch-btn').prop("checked", function() {
                        if ($(this).is(':checked')) {
                            return false
                        } else {
                            return true
                        }
                    })
                    // console.log('123123123')
    
            })
        })
        // ==========================
        // 侧边导航下拉列表
        // ==========================
    
    $('.tpl-left-nav-link-list').on('click', function() {
            $(this).siblings('.tpl-left-nav-sub-menu').slideToggle(80)
                .end()
                .find('.tpl-left-nav-more-ico').toggleClass('tpl-left-nav-more-ico-rotate');
        })
        // ==========================
        // 头部导航隐藏菜单
        // ==========================
    
    $('.tpl-header-nav-hover-ico').on('click', function() {
        $('.tpl-left-nav').toggle();
        $('.tpl-content-wrapper').toggleClass('tpl-content-wrapper-hover');
    })


    $(function(){
    $(".logout").click(function () {
        $.ajax({
            type: "post",
            url: "/author/logout",
            datatype: "json",
            success: function (data) {
                console.log(data.code)
                if (data.code = 1) {
                    location.href = "../login.html"
                }
            }
        })
    })
})
    
   